kvm: x86: mmu: Recovery of shattered NX large pages
authorJunaid Shahid <junaids@google.com>
Mon, 4 Nov 2019 19:26:00 +0000 (20:26 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 19 Nov 2019 01:43:33 +0000 (01:43 +0000)
commit05d35def3612197652a2e3e203de8cc37713b7c2
tree417b45354b4dbccbef9a440e41865bb1c6e55074
parent1a2adf24c6be53bc37676ccd96dbf516778390ef
kvm: x86: mmu: Recovery of shattered NX large pages

The page table pages corresponding to broken down large pages are zapped in
FIFO order, so that the large page can potentially be recovered, if it is
not longer being used for execution.  This removes the performance penalty
for walking deeper EPT page tables.

By default, one large page will last about one hour once the guest
reaches a steady state.

Signed-off-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bwh: Backported to 5.3:
 - Update another error path in kvm_create_vm() to use out_err_no_mmu_notifier
 - Adjust context]

Gbp-Pq: Topic bugfix/x86/itlb_multihit
Gbp-Pq: Name 0006-kvm-x86-mmu-Recovery-of-shattered-NX-large-pages.patch
Documentation/admin-guide/kernel-parameters.txt
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/x86.c
virt/kvm/kvm_main.c